﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace MS.InformationManagement.DAL.DocumentCenter
{
    public class FileEntity
    {
        public int FileSize { get; set; }
        public int ItemId { get; set; }
        public string FileName { get; set; }
        public Guid libraryGuid { get; set; }
        public DateTime CreationDate { get; set; }
        public byte[] FileContent { get; set; }
        public bool IsMainDocument { get; set; }
        public string Extension
        {
            get
            {
                if (string.IsNullOrEmpty(FileName)) { return string.Empty; }
                else
                {
                    int index = FileName.LastIndexOf('.') + 1;
                    if (index == 0) { return string.Empty; }
                    else { return FileName.Substring(index); }
                }
            }
        }
    }
}
